<?php
//
namespace app\circle\controller\admin;

use app\circle\model\MeetingSignModel;
use think\Request;

class MeetingSignController extends BaseController
{

    private $meetingSignModel;

    public function __construct(Request $request)
    {
        parent::__construct($request);
        $this->meetingSignModel = new MeetingSignModel();
    }

    /**
     * 首页
     * @return mixed
     */
    public function index()
    {
        if($this->adminInfo['admin_power']==3){
            $map['admin_id'] = $this->adminInfo['admin_id'];
            $query['admin_id'] = $this->adminInfo['admin_id'];
        }
        $list = $this->meetingSignModel->where($map)->paginate(12, false,['query'=>$query]);
        $this->assign('list', $list);
        return $this->fetch();
    }

    /**
     * 修改
     */
    public function edit(){
        if($this->request->isAjax()){
            $data = $this->request->param();
            $data['admin_id'] = $this->adminInfo['admin_id'];
            $data['admin_truename'] = $this->adminInfo['admin_truename'];
            $this->meetingSignModel->editData($data);
            $this->success('操作成功！','index');
        }
        $id = $this->request->param('id');
        $info = $this->meetingSignModel->where('id',$id)->find();
        $this->assign('info',$info);
        return $this->fetch();
    }
    /**
     * 删除
     */
    public function del(){
        $id = $this->request->param('id/d');
        $this->meetingSignModel->where('id',$id)->delete();
        $this->success('删除成功！');
    }

}
